﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace ARS.PublicTool.FormsHelper
{
    public class ComboBoxHelper
    {
        public void AddComboxItem(ComboBox combox, string[] list)
        {
            List<ControlListItem> items = new List<ControlListItem>();
            foreach (string str in list)
            {
                var item = new ControlListItem();
                item.Text = str;
                item.Value = str;
                //combox.Items.Add(item);
                items.Add(item);
            }
            combox.DataSource = items;

            combox.DisplayMember = "Text";
            combox.ValueMember = "Value";
        }
    }
}
